package com.ruoyi.system.outto.game.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.GlobalException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.UUIDGenerator;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.system.model.domain.*;
import com.ruoyi.system.model.mapper.AccountInfoMapper;
import com.ruoyi.system.V2.inter.mapper.ArtRecMapper;
import com.ruoyi.system.model.mapper.InfoImgMapper;
import com.ruoyi.system.V2.inter.mapper.SelectPushMapper;
import com.ruoyi.system.outto.core.KJCoverGameType;
import com.ruoyi.system.outto.core.LCConstant;
import com.ruoyi.system.outto.core.RegionalCovert;
import com.ruoyi.system.outto.core.constant.GameTypeConstant;
import com.ruoyi.system.outto.game.CommonApi;
import com.ruoyi.system.outto.game.KEJINAPI;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

/**
 * @author lz
 * @version 1.0
 * @date 2022/6/16 16:06
 */
@Slf4j
@Service
public class KEJINAPIImpl implements KEJINAPI {
    @Autowired
    private InfoImgMapper infoImgMapper;
    @Resource
    private CommonApi commonApi;

    @Resource
    private SelectPushMapper selectPushMapper;
    @Resource
    private AccountInfoMapper accountInfoMapper;

    @Resource
    private ArtRecMapper artRecMapper;

    @Value("${kejin.devUrl}")
    private String KjsBaseUrl;

    private SalePartner salePartner;

    /**
     * 测试key 71kjsed1b8b75d5
     * 测试secret 661b6ccb29b5d22c51148a1231327
     */
    private Map<String, Object> params(AccountInfo accountInfo, SalePartner sa) {
        salePartner = sa;
        Map<String, Object> params = getSign(sa);

        String des = accountInfo.getDes();
        des = "xyr" + accountInfo.getId() + "|" + accountInfo.getLevel() + des;
        if (des.length() > 999) {
            des = des.substring(0, 999);
        }

        accountInfo.setDes(des);

        String type = accountInfo.getType();
        Integer id = KJCoverGameType.getId(type);
        if (id == null) {
            log.error("游戏类型未找到---{}", type);
            throw new GlobalException("游戏类型未找到");
        }
        Long kjsid = accountInfo.getKjsid();
        if (Objects.nonNull(kjsid)) {
            params.put("id", accountInfo.getKjsid());
        } else {
            params.put("up_goods_id", accountInfo.getId().toString());
        }

        params.put("game_id", id.intValue());
        params.put("title", accountInfo.getDes());
        String regional = RegionalCovert.toKJS(accountInfo.getRegional(), type);
        if (StringUtils.isEmpty(regional)) {
            throw new GlobalException("大区转换失败，当前系统大区是" + accountInfo.getRegional());
        }

        params.put("area_id", Integer.valueOf(regional));
        String serverId = RegionalCovert.toKJSserver(accountInfo.getRegional(), type);
        if ("CF端游".equals(type)) {

            //[{"servers":[{"parent_id":58,"id":59,"title":"福建一区","top_parent_id":57},{"parent_id":58,"id":60,"title":"安徽一区","top_parent_id":57},{"parent_id":58,"id":61,"title":"上海一区","top_parent_id":57},{"parent_id":58,"id":62,"title":"上海二区","top_parent_id":57},{"parent_id":58,"id":63,"title":"浙江一区","top_parent_id":57},{"parent_id":58,"id":64,"title":"浙江二区","top_parent_id":57},{"parent_id":58,"id":65,"title":"江苏一区","top_parent_id":57},{"parent_id":58,"id":66,"title":"江苏二区","top_parent_id":57},{"parent_id":58,"id":67,"title":"移动专区","top_parent_id":57},{"parent_id":58,"id":68,"title":"教育网专区","top_parent_id":57}],"id":58,"title":"东部战区"},{"servers":[{"parent_id":86,"id":92,"title":"山西一区","top_parent_id":57},{"parent_id":86,"id":87,"title":"河南一区","top_parent_id":57},{"parent_id":86,"id":88,"title":"河南二区","top_parent_id":57},{"parent_id":86,"id":89,"title":"河北一区","top_parent_id":57},{"parent_id":86,"id":90,"title":"山东一区","top_parent_id":57},{"parent_id":86,"id":91,"title":"山东二区","top_parent_id":57},{"parent_id":86,"id":93,"title":"北京一区","top_parent_id":57},{"parent_id":86,"id":94,"title":"北京二区","top_parent_id":57},{"parent_id":86,"id":95,"title":"北京三区","top_parent_id":57},{"parent_id":86,"id":96,"title":"北京四区","top_parent_id":57},{"parent_id":86,"id":97,"title":"北方大区","top_parent_id":57},{"parent_id":86,"id":98,"title":"辽宁一区","top_parent_id":57},{"parent_id":86,"id":99,"title":"辽宁二区","top_parent_id":57},{"parent_id":86,"id":100,"title":"辽宁三区","top_parent_id":57},{"parent_id":86,"id":101,"title":"黑龙江区","top_parent_id":57},{"parent_id":86,"id":102,"title":"吉林一区","top_parent_id":57}],"id":86,"title":"北部战区"},{"servers":[{"parent_id":69,"id":70,"title":"四川一区","top_parent_id":57},{"parent_id":69,"id":71,"title":"四川二区","top_parent_id":57},{"parent_id":69,"id":72,"title":"重庆一区","top_parent_id":57},{"parent_id":69,"id":73,"title":"陕西一区","top_parent_id":57},{"parent_id":69,"id":74,"title":"云南一区","top_parent_id":57}],"id":69,"title":"西部战区"},{"servers":[{"parent_id":75,"id":84,"title":"广东四区","top_parent_id":57},{"parent_id":75,"id":85,"title":"南方大区","top_parent_id":57},{"parent_id":75,"id":82,"title":"广东二区","top_parent_id":57},{"parent_id":75,"id":83,"title":"广东三区","top_parent_id":57},{"parent_id":75,"id":81,"title":"广东一区","top_parent_id":57},{"parent_id":75,"id":80,"title":"湖北二区","top_parent_id":57},{"parent_id":75,"id":76,"title":"江西一区","top_parent_id":57},{"parent_id":75,"id":77,"title":"湖南一区","top_parent_id":57},{"parent_id":75,"id":78,"title":"湖南二区","top_parent_id":57},{"parent_id":75,"id":79,"title":"湖北一区","top_parent_id":57},{"parent_id":75,"id":103,"title":"广西一区","top_parent_id":57}],"id":75,"title":"南部战区"}]

            String r = "[{\"servers\":[{\"parent_id\":58,\"id\":59,\"title\":\"福建一区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":60,\"title\":\"安徽一区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":61,\"title\":\"上海一区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":62,\"title\":\"上海二区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":63,\"title\":\"浙江一区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":64,\"title\":\"浙江二区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":65,\"title\":\"江苏一区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":66,\"title\":\"江苏二区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":67,\"title\":\"移动专区\",\"top_parent_id\":57},{\"parent_id\":58,\"id\":68,\"title\":\"教育网专区\",\"top_parent_id\":57}],\"id\":58,\"title\":\"东部战区\"},{\"servers\":[{\"parent_id\":86,\"id\":92,\"title\":\"山西一区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":87,\"title\":\"河南一区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":88,\"title\":\"河南二区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":89,\"title\":\"河北一区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":90,\"title\":\"山东一区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":91,\"title\":\"山东二区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":93,\"title\":\"北京一区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":94,\"title\":\"北京二区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":95,\"title\":\"北京三区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":96,\"title\":\"北京四区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":97,\"title\":\"北方大区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":98,\"title\":\"辽宁一区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":99,\"title\":\"辽宁二区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":100,\"title\":\"辽宁三区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":101,\"title\":\"黑龙江区\",\"top_parent_id\":57},{\"parent_id\":86,\"id\":102,\"title\":\"吉林一区\",\"top_parent_id\":57}],\"id\":86,\"title\":\"北部战区\"},{\"servers\":[{\"parent_id\":69,\"id\":70,\"title\":\"四川一区\",\"top_parent_id\":57},{\"parent_id\":69,\"id\":71,\"title\":\"四川二区\",\"top_parent_id\":57},{\"parent_id\":69,\"id\":72,\"title\":\"重庆一区\",\"top_parent_id\":57},{\"parent_id\":69,\"id\":73,\"title\":\"陕西一区\",\"top_parent_id\":57},{\"parent_id\":69,\"id\":74,\"title\":\"云南一区\",\"top_parent_id\":57}],\"id\":69,\"title\":\"西部战区\"},{\"servers\":[{\"parent_id\":75,\"id\":84,\"title\":\"广东四区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":85,\"title\":\"南方大区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":82,\"title\":\"广东二区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":83,\"title\":\"广东三区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":81,\"title\":\"广东一区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":80,\"title\":\"湖北二区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":76,\"title\":\"江西一区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":77,\"title\":\"湖南一区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":78,\"title\":\"湖南二区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":79,\"title\":\"湖北一区\",\"top_parent_id\":57},{\"parent_id\":75,\"id\":103,\"title\":\"广西一区\",\"top_parent_id\":57}],\"id\":75,\"title\":\"南部战区\"}]\n";
            JSONArray objects = JSONArray.parseArray(r);
            for (Object object : objects) {
                String string = JSONObject.toJSONString(object);
                JSONObject jsonObject = JSONObject.parseObject(string);
                String replace = jsonObject.getString("title").replace("战", "大");
                if (replace.equals(accountInfo.getRegional())) {
                    String servers = jsonObject.getString("servers");
                    JSONArray serversList = JSONArray.parseArray(servers);
                    for (Object o : serversList) {
                        String serve = JSONObject.toJSONString(o);
                        JSONObject serverJson = JSONObject.parseObject(serve);
                        String title = serverJson.getString("title");
                        String substring = title.substring(0, 2);
                        if (accountInfo.getDes().contains(substring)) {
                            params.put("server_id", serverJson.getString("id"));
                        }
                    }
                }
            }
        } else {
            if (!"不用传".equals(serverId)) {
                params.put("server_id", serverId != null ? Integer.valueOf(serverId) : null);
            }
        }
        BigDecimal bigDecimal = commonApi.addPrice(accountInfo.getPrice(), sa.getSeleep());
        commonApi.setPrice(bigDecimal,accountInfo.getId(),sa);
        int price = bigDecimal.intValue();
        params.put("price", price);
        params.put("up_price", price);
        params.put("game_account", "---");

        params.put("mobile", sa.getThreeOther() == null ? "15173678868" : sa.getThreeOther());

        String propertyJson = null;
        if (GameTypeConstant.WZRY.equals(type)) {
            //王者荣耀
            propertyJson = wzryProperty(accountInfo);
        } else if (GameTypeConstant.HPJY.equals(type)) {
            //和平精英
            propertyJson = hpjyProperty(accountInfo);
        } else if (GameTypeConstant.YS.equals(type)) {
            //原神
            propertyJson = ysProperty(accountInfo);
        } else if (GameTypeConstant.LOL.equals(type)) {
            //英雄联盟
            propertyJson = lolProperty(accountInfo);
        } else if (GameTypeConstant.LOLMOBILE.equals(type)) {
            //英雄联盟手游
            propertyJson = lolmoblieProperty(accountInfo);
        } else if (GameTypeConstant.CF.equals(type)) {
            //CF端游
            propertyJson = cfProperty(accountInfo);
        } else if (GameTypeConstant.CFMOBILE.equals(type)) {
            //CF端游
            propertyJson = cfmProperty(accountInfo);
        } else if (GameTypeConstant.HYRZ.equals(type)) {
            //火影忍者
            propertyJson = hyrzProperty(accountInfo);
        } else if (GameTypeConstant.NZ.equals(type)) {
            //逆战
            propertyJson = nzProperty(accountInfo);
        } else if ("QQ飞车端游".equals(accountInfo.getType())) {
            //逆战
            propertyJson = qqCarProperty(accountInfo);
        } else if ("QQ飞车手游".equals(accountInfo.getType())) {
            //逆战
            propertyJson = qqCarMProperty(accountInfo);
        } else if ("永劫无间".equals(accountInfo.getType())) {
            //永劫无间
            propertyJson = yjwjProperty(accountInfo);
        }
        params.put("property", propertyJson);
        return params;
    }


    private String yjwjProperty(AccountInfo accountInfo) {

        List<Map<String, Object>> propertys = new ArrayList<>();

        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 88);
        shimgingg.put("val", 560);
        propertys.add(shimgingg);

        //个人主页
        Map<String, Object> imgs = new HashMap<>();
        imgs.put("id", 95);
        InfoImg infoImg = new InfoImg();
        infoImg.setInfoId(accountInfo.getId());
        infoImg.setType(Constants.STR_1);
        List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
        if (CollectionUtils.isEmpty(infoImgs)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());
            imgs.put("val", collect);
        }
        propertys.add(imgs);

        String propertyJson = JSONObject.toJSONString(propertys);

        return propertyJson;

    }


    private String qqCarProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();

        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 231);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1745);
        } else {
            shimgingg.put("val", 1747);
        }
        propertys.add(shimgingg);

        //个人主页
        Map<String, Object> imgs = new HashMap<>();
        imgs.put("id", 236);
        InfoImg infoImg = new InfoImg();
        infoImg.setInfoId(accountInfo.getId());
        infoImg.setType(Constants.STR_1);
        List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
        if (CollectionUtils.isEmpty(infoImgs)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());
            imgs.put("val", collect);
        }
        propertys.add(imgs);

        String propertyJson = JSONObject.toJSONString(propertys);

        return propertyJson;
    }


    private String nzProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();

        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 541);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 6239);
        } else {
            shimgingg.put("val", 6241);
        }
        propertys.add(shimgingg);

        //个人主页
        Map<String, Object> imgs = new HashMap<>();
        imgs.put("id", 544);
        InfoImg infoImg = new InfoImg();
        infoImg.setInfoId(accountInfo.getId());
        infoImg.setType(Constants.STR_1);
        List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
        if (CollectionUtils.isEmpty(infoImgs)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            log.info(collect.toString());
            imgs.put("val", collect);
        }
        propertys.add(imgs);

        String propertyJson = JSONObject.toJSONString(propertys);

        return propertyJson;
    }


    private String cfProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();


        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 171);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1392);
        } else {
            shimgingg.put("val", 1394);
        }
        propertys.add(shimgingg);

        //个人主页
        Map<String, Object> imgs = new HashMap<>();
        imgs.put("id", 201);
        InfoImg infoImg = new InfoImg();
        infoImg.setInfoId(accountInfo.getId());
        infoImg.setType(Constants.STR_1);
        List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
        if (CollectionUtils.isEmpty(infoImgs)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            log.info(collect.toString());
            imgs.put("val", collect);
        }
        propertys.add(imgs);

        Map<String, Object> imgs1 = new HashMap<>();
        imgs1.put("id", 203);
        InfoImg infoImg1 = new InfoImg();
        infoImg1.setInfoId(accountInfo.getId());
        infoImg1.setType(Constants.STR_1);
        List<InfoImg> infoImgList = infoImgMapper.selectInfoImgList(infoImg1);
        if (CollectionUtils.isEmpty(infoImgList)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add(accountInfo.getTitleImg());
            imgs1.put("val", initImg);
        } else {
            List<String> collect = infoImgList.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            imgs1.put("val", collect);
        }
        propertys.add(imgs1);


        JSONArray objects = gameType(accountInfo.getType());
        if (Objects.nonNull(objects)) {
            for (Object object : objects) {
                String string = JSON.toJSONString(object);
                JSONObject jsonObject = JSONObject.parseObject(string);
                if (Objects.equals("套装", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("V武器", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("王者武器", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("炫金武器", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("热门武器", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("AK47稀有皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("M4A1稀有皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("狙击枪稀有皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("其他稀有皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("英雄角色", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("音效道具", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
            }
        }
        String propertyJson = JSONObject.toJSONString(propertys);


        return propertyJson;
    }


    private String qqCarMProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();


        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 244);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1759);
        } else {
            shimgingg.put("val", 1761);
        }
        propertys.add(shimgingg);

        //个人主页
        Map<String, Object> imgs = new HashMap<>();
        imgs.put("id", 487);
        InfoImg infoImg = new InfoImg();
        infoImg.setInfoId(accountInfo.getId());
        infoImg.setType(Constants.STR_1);
        List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
        if (CollectionUtils.isEmpty(infoImgs)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            log.info(collect.toString());
            imgs.put("val", collect);
        }
        propertys.add(imgs);


        Map<String, Object> jietu = new HashMap<>();
        jietu.put("id", 247);
        InfoImg infoImg1 = new InfoImg();
        infoImg1.setInfoId(accountInfo.getId());
        infoImg1.setType(Constants.STR_1);
        List<InfoImg> infoImgList = infoImgMapper.selectInfoImgList(infoImg1);
        if (CollectionUtils.isEmpty(infoImgList)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            jietu.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            log.info(collect.toString());
            jietu.put("val", collect);
        }
        propertys.add(jietu);


//        JSONArray objects = gameType(accountInfo.getType());
//        if (Objects.nonNull(objects)){
//            for (Object object : objects) {
//                String string = JSON.toJSONString(object);
//                JSONObject jsonObject = JSONObject.parseObject(string);
//                if (Objects.equals("永久T车（皮肤）",jsonObject.getString("title"))){
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)){
//                            neiceList.add(id);
//                        }
//                    }
//                    if (CollectionUtils.isNotEmpty(neiceList) && !"$[1]".equals(outId)){
//                        zaiju.put("val", neiceList);
//                        zaiju.put("id", outId);
//                        propertys.add(zaiju);
//                    }
//
//                }
//                if (Objects.equals("永久A车",jsonObject.getString("title"))){
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)){
//                            neiceList.add(id);
//                        }
//                    }
//                    if (CollectionUtils.isNotEmpty(neiceList) && !"$[1]".equals(outId)){
//                        zaiju.put("val", neiceList);
//                        zaiju.put("id", outId);
//                        propertys.add(zaiju);
//                    }
//                }
//                if (Objects.equals("特殊宠物",jsonObject.getString("title"))){
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)){
//                            neiceList.add(id);
//                        }
//                    }
//                    if (CollectionUtils.isNotEmpty(neiceList) && !"$[1]".equals(outId)){
//                        zaiju.put("val", neiceList);
//                        zaiju.put("id", outId);
//                        propertys.add(zaiju);
//                    }
//                }
//            }
//        }
        String propertyJson = JSONObject.toJSONString(propertys);


        return propertyJson;
    }


    private String cfmProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();


        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 242);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1754);
        } else {
            shimgingg.put("val", 1756);
        }
        propertys.add(shimgingg);

        //个人主页
        Map<String, Object> imgs = new HashMap<>();
        imgs.put("id", 488);
        InfoImg infoImg = new InfoImg();
        infoImg.setInfoId(accountInfo.getId());
        infoImg.setType(Constants.STR_1);
        List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
        if (CollectionUtils.isEmpty(infoImgs)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add(accountInfo.getTitleImg());
            imgs.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            imgs.put("val", collect);
        }
        propertys.add(imgs);

        Map<String, Object> imgs1 = new HashMap<>();
        imgs1.put("id", 245);
        InfoImg infoImg1 = new InfoImg();
        infoImg1.setInfoId(accountInfo.getId());
        infoImg1.setType(Constants.STR_1);
        List<InfoImg> infoImgList = infoImgMapper.selectInfoImgList(infoImg1);
        if (CollectionUtils.isEmpty(infoImgList)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add(accountInfo.getTitleImg());
            imgs1.put("val", initImg);
        } else {
            List<String> collect = infoImgList.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            imgs1.put("val", collect);
        }
        propertys.add(imgs1);

        JSONArray objects = gameType(accountInfo.getType());
        if (Objects.nonNull(objects)) {
            for (Object object : objects) {
                String string = JSON.toJSONString(object);
                JSONObject jsonObject = JSONObject.parseObject(string);
                if (Objects.equals("v武器", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("v角色", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("枪械皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("音效卡", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
//                if (Objects.equals("贵族等级",jsonObject.getString("title"))){
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)){
//                            neiceList.add(id);
//                            continue;
//                        }
//                    }
//                    if (CollectionUtils.isNotEmpty(neiceList)){
//                        zaiju.put("val", neiceList);
//                        zaiju.put("id", outId);
//                        propertys.add(zaiju);
//                    }
//                }
            }
        }
        String propertyJson = JSONObject.toJSONString(propertys);


        return propertyJson;
    }

    private String hyrzProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();

        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 213);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1724);
        } else {
            shimgingg.put("val", 1726);
        }
        propertys.add(shimgingg);

        //个人主页
        Map<String, Object> imgs = new HashMap<>();
        imgs.put("id", 485);
        InfoImg infoImg = new InfoImg();
        infoImg.setInfoId(accountInfo.getId());
        infoImg.setType(Constants.STR_1);
        List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
        if (CollectionUtils.isEmpty(infoImgs)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            log.info(collect.toString());
            imgs.put("val", collect);
        }
        propertys.add(imgs);


        //游戏截图
        Map<String, Object> jietu = new HashMap<>();
        jietu.put("id", 217);
        InfoImg infoImg1 = new InfoImg();
        infoImg1.setInfoId(accountInfo.getId());
        infoImg1.setType(Constants.STR_1);
        List<InfoImg> infoImgList = infoImgMapper.selectInfoImgList(infoImg1);
        if (CollectionUtils.isEmpty(infoImgList)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            jietu.put("val", initImg);
        } else {
            List<String> collect = infoImgs.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());

            log.info(collect.toString());
            jietu.put("val", collect);
        }
        propertys.add(jietu);

        JSONArray objects = gameType(accountInfo.getType());
        if (Objects.nonNull(objects)) {
            for (Object object : objects) {
                String string = JSON.toJSONString(object);
                JSONObject jsonObject = JSONObject.parseObject(string);
                if (Objects.equals("五星S", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("四星S", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("普通S", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("五星A", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("普通A", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("五星A", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("通灵兽", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
            }
        }
        String propertyJson = JSONObject.toJSONString(propertys);


        return propertyJson;
    }

    //王者荣耀参数
    private String wzryProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();

        Map<String, Object> heros = new HashMap<>();
        heros.put("id", 4);
        heros.put("val", accountInfo.getHeroes());
        propertys.add(heros);

        Map<String, Object> skins = new HashMap<>();
        skins.put("id", 5);
        skins.put("val", accountInfo.getSkins());
        propertys.add(skins);


        Map<String, Object> yingdiID = new HashMap<>();
        yingdiID.put("id", 6);
        String campId = accountInfo.getCampId();
        yingdiID.put("val", StringUtils.isEmpty(campId) ? "1" : campId);
        propertys.add(yingdiID);

        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 12);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1102);
        } else {
            shimgingg.put("val", 1101);
        }
        propertys.add(shimgingg);

        //亮点
        Map<String, Object> ld = new HashMap<>();
        ld.put("id", 18);
        String des = accountInfo.getDes();
        if (!StringUtils.isEmpty(des)) {
            ld.put("val", des.length() < 200 ? des : des.substring(0, 199));
        } else {
            ld.put("val", "---");
        }
        propertys.add(ld);

        Map<String, Object> shimingjietu = new HashMap<>();
        ArrayList<String> zhuyeImgs = new ArrayList<>();
        zhuyeImgs.add("https://game.ikbh.top/logo/no_img.jpg");
        shimingjietu.put("id", 145);
        shimingjietu.put("val", zhuyeImgs);
        propertys.add(shimingjietu);


        //个人主页
        Map<String, Object> imgs = new HashMap<>();
        imgs.put("id", 283);
//        InfoImg infoImg = new InfoImg();
//        infoImg.setInfoId(accountInfo.getId());
//        infoImg.setType(Constants.STR_1);
//        List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
        String titleImg = accountInfo.getTitleImg();
        if (StringUtils.isEmpty(titleImg)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs.put("val", titleImg);
        } else {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add(titleImg);
            imgs.put("val", titleImg);
        }
        propertys.add(imgs);


        //游戏截图
        Map<String, Object> imgs2 = new HashMap<>();
        imgs2.put("id", 48);
        InfoImg infoImg2 = new InfoImg();
        infoImg2.setInfoId(accountInfo.getId());
        infoImg2.setType(Constants.STR_1);
        List<InfoImg> infoImgs2 = infoImgMapper.selectInfoImgList(infoImg2);
        if (CollectionUtils.isEmpty(infoImgs2)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs2.put("val", initImg);
        } else {
            List<String> collect = infoImgs2.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());
            log.info(collect.toString());
            imgs2.put("val", collect);
        }
        propertys.add(imgs2);

        JSONArray objects = gameType(accountInfo.getType());
        if (Objects.nonNull(objects)) {
            for (Object object : objects) {
                String string = JSON.toJSONString(object);
                JSONObject jsonObject = JSONObject.parseObject(string);
                if (Objects.equals("内测皮肤",jsonObject.getString("title"))){
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)){
                            neiceList.add(id);
                            continue;
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("稀有英雄", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("荣耀水晶", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("星传说", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("传说皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("限定皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("史诗皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("内测皮肤", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
            }
        }
        String propertyJson = JSONObject.toJSONString(propertys);

        return propertyJson;
    }

    //和平参数
    private String hpjyProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();


        Map<String, Object> shimingjietu = new HashMap<>();
        ArrayList<String> zhuyeImgs = new ArrayList<>();
        zhuyeImgs.add("https://game.ikbh.top/logo/no_img.jpg");
        shimingjietu.put("id", 167);
        shimingjietu.put("val", zhuyeImgs);
        propertys.add(shimingjietu);

        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 50);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1107);
        } else {
            shimgingg.put("val", 1109);
        }

        propertys.add(shimgingg);

        //亮点
        Map<String, Object> ld = new HashMap<>();
        ld.put("id", 60);
        String des = accountInfo.getDes();
        if (StringUtils.isNotEmpty(des)) {
            ld.put("val", des.length() < 200 ? des : des.substring(0, 199));
        } else {
            ld.put("val", "---");
        }
        propertys.add(ld);

        //游戏截图
        Map<String, Object> imgs2 = new HashMap<>();
        imgs2.put("id", 61);
        InfoImg infoImg2 = new InfoImg();
        infoImg2.setInfoId(accountInfo.getId());
        infoImg2.setType(Constants.STR_1);
        List<InfoImg> infoImgs2 = infoImgMapper.selectInfoImgList(infoImg2);
        if (CollectionUtils.isEmpty(infoImgs2)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs2.put("val", initImg);
        } else {
            List<String> collect = infoImgs2.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());
            log.info(collect.toString());
            imgs2.put("val", collect);
        }
        propertys.add(imgs2);

        JSONArray objects = gameType(accountInfo.getType());
        if (Objects.nonNull(objects)) {
            for (Object object : objects) {
                String string = JSON.toJSONString(object);
                JSONObject jsonObject = JSONObject.parseObject(string);
                if (Objects.equals("载具", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("稀有枪皮", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("热门装扮", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("优质战备", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("普通枪皮", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("普通装扮", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
                if (Objects.equals("稀有战备", jsonObject.getString("title"))) {
                    String val = jsonObject.getString("val");
                    String outId = jsonObject.getString("id");
                    JSONArray parse = JSONArray.parseArray(val);

                    Map<String, Object> zaiju = new HashMap<>();
                    List<String> neiceList = new ArrayList<>();
                    for (Object o : parse) {
                        String skinObj = JSON.toJSONString(o);
                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
                        String title = skinObjJson.getString("title");
                        String id = skinObjJson.getString("id");
                        if (accountInfo.getDes().contains(title)) {
                            neiceList.add(id);
                        }
                    }
                    zaiju.put("val", neiceList);
                    zaiju.put("id", outId);
                    propertys.add(zaiju);
                }
            }
        }


        String propertyJson = JSONObject.toJSONString(propertys);
        return propertyJson;
    }

    //原神参数
    private String ysProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();


        Map<String, Object> mail = new HashMap<>();
        mail.put("id", 122);
        mail.put("val", 1669);

        propertys.add(mail);

        //米哈游账号信息截图（仅用于审核"
        Map<String, Object> mihajietu = new HashMap<>();
        ArrayList<String> mimaImgs = new ArrayList<>();
        mimaImgs.add("https://game.ikbh.top/logo/no_img.jpg");
        mihajietu.put("id", 270);
        mihajietu.put("val", mimaImgs);
        propertys.add(mihajietu);

        //冒险等级
        Map<String, Object> maoxian = new HashMap<>();
        maoxian.put("id", 123);
        maoxian.put("val", "25");
        propertys.add(maoxian);
        //亮点
        Map<String, Object> desmap = new HashMap<>();
        String des = accountInfo.getDes();
        desmap.put("id", 141);
        if (StringUtils.isEmpty(des)) {
            desmap.put("val", "---");
        } else {
            desmap.put("val", des.length() < 200 ? des : des.substring(0, 199));
        }
        propertys.add(desmap);

        String titleImg = accountInfo.getTitleImg();
        Map<String, Object> shoutu = new HashMap<>();
        shoutu.put("id", 500);
        shoutu.put("val", titleImg);

        //游戏截图
        Map<String, Object> imgs2 = new HashMap<>();
        imgs2.put("id", 139);
        InfoImg infoImg2 = new InfoImg();
        infoImg2.setInfoId(accountInfo.getId());
        infoImg2.setType(Constants.STR_1);
        List<InfoImg> infoImgs2 = infoImgMapper.selectInfoImgList(infoImg2);
        if (CollectionUtils.isEmpty(infoImgs2)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs2.put("val", initImg);
        } else {
            List<String> collect = infoImgs2.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());
            log.info(collect.toString());
            imgs2.put("val", collect);
        }
        propertys.add(imgs2);

        JSONArray objects = gameType(accountInfo.getType());
//        if (Objects.nonNull(objects)) {
//            for (Object object : objects) {
//                String string = JSON.toJSONString(object);
//                JSONObject jsonObject = JSONObject.parseObject(string);
//                if (Objects.equals("拥有金色角色", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("6命金色角色", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("5命金色角色", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("4命金色角色", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("3命金色角色", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("2命金色角色", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("1命金色角色", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("0命金色角色", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("拥有武器", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("5精武器", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("4精武器", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("3精武器", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("2精武器", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("1精武器", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//            }
//        }

        String propertyJson = JSONObject.toJSONString(propertys);
        return propertyJson;
    }

    //lol参数
    private String lolProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();

        Map<String, Object> shimingjietu = new HashMap<>();
        ArrayList<String> zhuyeImgs = new ArrayList<>();
        zhuyeImgs.add(accountInfo.getTitleImg());
        shimingjietu.put("id", 166);
        shimingjietu.put("val", zhuyeImgs);
        propertys.add(shimingjietu);


        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 31);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1104);
        } else {
            shimgingg.put("val", 1106);
        }
        propertys.add(shimgingg);

        //英雄数
        Map<String, Object> heros = new HashMap<>();
        heros.put("id", 34);
        heros.put("val", accountInfo.getHeroes() == null ? "99" : accountInfo.getHeroes());
        propertys.add(heros);

        //皮肤数
        Map<String, Object> skins = new HashMap<>();
        skins.put("id", 35);
        skins.put("val", accountInfo.getSkins() == null ? "99" : accountInfo.getSkins());
        propertys.add(skins);

        //亮点
        Map<String, Object> desmap = new HashMap<>();
        String des = accountInfo.getDes();
        desmap.put("id", 268);
        if (StringUtils.isEmpty(des)) {
            desmap.put("val", "---");
        } else {
            desmap.put("val", des.length() < 200 ? des : des.substring(0, 199));
        }
        propertys.add(desmap);
        //游戏截图
        Map<String, Object> imgs2 = new HashMap<>();
        imgs2.put("id", 47);
        InfoImg infoImg2 = new InfoImg();
        infoImg2.setInfoId(accountInfo.getId());
        infoImg2.setType(Constants.STR_1);
        List<InfoImg> infoImgs2 = infoImgMapper.selectInfoImgList(infoImg2);
        if (CollectionUtils.isEmpty(infoImgs2)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs2.put("val", initImg);
        } else {
            List<String> collect = infoImgs2.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());
            log.info(collect.toString());
            imgs2.put("val", collect);
        }
        propertys.add(imgs2);

        JSONArray objects = gameType(accountInfo.getType());
//        if (Objects.nonNull(objects)) {
//            for (Object object : objects) {
//                String string = JSON.toJSONString(object);
//                JSONObject jsonObject = JSONObject.parseObject(string);
//                if (Objects.equals("限定", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("至臻", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("海克斯", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("年限", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("周年", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("情人节限定", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("冰雪节限定", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("赛季限定皮肤", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("冠军限定系列", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("泳池派对", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("万圣节限定", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("终极皮肤", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("龙瞎炫彩", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//                if (Objects.equals("其他限定/神话皮肤", jsonObject.getString("title"))) {
//                    String val = jsonObject.getString("val");
//                    String outId = jsonObject.getString("id");
//                    JSONArray parse = JSONArray.parseArray(val);
//
//                    Map<String, Object> zaiju = new HashMap<>();
//                    List<String> neiceList = new ArrayList<>();
//                    for (Object o : parse) {
//                        String skinObj = JSON.toJSONString(o);
//                        JSONObject skinObjJson = JSONObject.parseObject(skinObj);
//                        String title = skinObjJson.getString("title");
//                        String id = skinObjJson.getString("id");
//                        if (accountInfo.getDes().contains(title)) {
//                            neiceList.add(id);
//                        }
//                    }
//                    zaiju.put("val", neiceList);
//                    zaiju.put("id", outId);
//                    propertys.add(zaiju);
//                }
//            }
//        }

        String propertyJson = JSONObject.toJSONString(propertys);
        return propertyJson;
    }

    //英雄联盟手游
    private String lolmoblieProperty(AccountInfo accountInfo) {
        List<Map<String, Object>> propertys = new ArrayList<>();

        Map<String, Object> shimingjietu = new HashMap<>();
        ArrayList<String> zhuyeImgs = new ArrayList<>();
        zhuyeImgs.add("https://game.ikbh.top/logo/no_img.jpg");
        shimingjietu.put("id", 250);
        shimingjietu.put("val", zhuyeImgs);
        propertys.add(shimingjietu);

        Map<String, Object> shimgingg = new HashMap<>();
        shimgingg.put("id", 249);
        if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
            shimgingg.put("val", 1764);
        } else {
            shimgingg.put("val", 1766);
        }
        propertys.add(shimgingg);

        //亮点
        Map<String, Object> desmap = new HashMap<>();
        String des = accountInfo.getDes();
        desmap.put("id", 268);
        if (StringUtils.isEmpty(des)) {
            desmap.put("val", "---");
        } else {
            desmap.put("val", des.length() < 200 ? des : des.substring(0, 199));
        }
        propertys.add(desmap);

        //游戏截图
        Map<String, Object> imgs2 = new HashMap<>();
        imgs2.put("id", 252);
        InfoImg infoImg2 = new InfoImg();
        infoImg2.setInfoId(accountInfo.getId());
        infoImg2.setType(Constants.STR_1);
        List<InfoImg> infoImgs2 = infoImgMapper.selectInfoImgList(infoImg2);
        if (CollectionUtils.isEmpty(infoImgs2)) {
            ArrayList<String> initImg = new ArrayList<>();
            initImg.add("https://game.ikbh.top/logo/no_img.jpg");
            imgs2.put("val", initImg);
        } else {
            List<String> collect = infoImgs2.stream().map(img -> img.getImgUrl()).collect(Collectors.toList());
            log.info(collect.toString());
            imgs2.put("val", collect);
        }
        propertys.add(imgs2);
        String propertyJson = JSONObject.toJSONString(propertys);
        return propertyJson;
    }

    private static Map<String, Object> getSign(SalePartner sa) {

        String key = sa.getSaleKey();
        String secret = sa.getOther();
        Map<String, Object> params = new HashMap<>();
        params.put("key", key);
        String uuid4 = UUIDGenerator.generateUuid6();
        params.put("rand_str", uuid4);
        long time = DateUtils.getNowDate().getTime() / 1000;
        params.put("timestamp", time);

        String oldSign = "key=" + key + ",secret=" + secret + ",rand_str=" + uuid4 + ",timestamp=" + time;
        log.info("oldSign={}", oldSign);
        String sign = DigestUtils.md5Hex(oldSign);
        log.info("sign={}", sign);
        log.info("uuid4={}", uuid4);
        sign = DigestUtils.sha1Hex(sign + uuid4);
        params.put("sign", sign);
        return params;
    }

    @Override
    public AjaxResult addGame(AccountInfo accountInfo, Long userId, SalePartner salePartner) {

        String paramsStr = JSONObject.toJSONString(params(accountInfo, salePartner));
        log.info("氪金兽游新增请求参数={}", paramsStr);
        String url = KjsBaseUrl + "/api_up/account/goods/establish";
        String response = HttpUtils.sendPost(url, paramsStr, "application/json");
        log.info("氪金兽游戏新增返回参数={}", response);
        /* {    "status": 0,    "message": "[develop]编辑成功",    "data": {        "id": 1577    }}*/
//        {    "status": 0,    "message": "上架成功",    "data": {        "id": 316603    }}
        JSONObject resultJson = JSONObject.parseObject(response);

        Map<String, Object> result = new HashMap<>();

        if (!"0".equals(resultJson.getString("status"))) {
            result.put("code", 500);
        } else {
            result.put("code", 200);

            JSONObject jsonObject = JSONObject.parseObject(response);
            JSONObject data = jsonObject.getJSONObject("data");
            Long id = data.getLong("id");

            ArtRec artRec = new ArtRec();
            artRec.setAccountId(accountInfo.getId());
            artRec.setCreateId(accountInfo.getCreateId());
            artRec.setType(LCConstant.interAdd);
            artRec.setConfig(salePartner.getId());
            artRec.setSaleCode(salePartner.getSaleName());
            artRec.setOutid(id.toString());
            artRecMapper.insertArtRec(artRec);

            AccountInfo info = accountInfoMapper.selectAccountInfoById(accountInfo.getId());
            info.setKjsid(id);
            accountInfoMapper.updateAccountInfo(info);
        }

        result.put("req", paramsStr);
        result.put("res", response);
        result.put("msg", resultJson.getString("message"));
        return AjaxResult.success(result);
    }

    @Override
    public AjaxResult editGame(AccountInfo accountInfo, Long userId, SalePartner salePartner) {

        Map<String, Object> result = new HashMap<>();

        String paramsStr = JSONObject.toJSONString(params(accountInfo, salePartner));
        log.info("氪金兽游新增编辑参数={}", paramsStr);
        String url = KjsBaseUrl + "/api_up/account/goods/establish";
        String response = HttpUtils.sendPost(url, paramsStr, "application/json");
        log.info("氪金兽游戏新增编辑参数={}", response);
        JSONObject resultJson = JSONObject.parseObject(response);

        if (!"0".equals(resultJson.getString("status"))) {
            result.put("code", 500);
        } else {
            result.put("code", 200);
        }

        result.put("req", paramsStr);
        result.put("res", response);
        result.put("msg", resultJson.getString("message"));
        return AjaxResult.success(result);
    }

    @Override
    public AjaxResult delGame(Long id, Long userId, SalePartner sa) {
        //先下架

        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(id);

        Map<String, Object> sign = getSign(sa);
        sign.put("id", accountInfo.getKjsid());
//        sign.put("up_goods_id", id);
        String paramsStr = JSONObject.toJSONString(sign);
        log.info("氪金兽游删除下架请求参数={}", paramsStr);
        String upperurl = KjsBaseUrl + "/api_up/account/goods/under";
        //先下架

        String response = HttpUtils.sendPost(upperurl, paramsStr, "application/json");
        log.info("氪金兽游戏下架返回参数={}", response);
        JSONObject resultJson = JSONObject.parseObject(response);
        Map<String, Object> result = new HashMap<>();

        if (!"0".equals(resultJson.getString("status"))) {
            result.put("code", 500);
        } else {
            result.put("code", 200);
        }

        result.put("req", paramsStr);
        result.put("res", response);
        result.put("msg", resultJson.getString("message"));
        return AjaxResult.success(result);
    }


    private JSONArray gameType(String type) {
        String key = salePartner.getSaleKey();
        String secret = salePartner.getOther();

        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("secret", secret);
        String uuid4 = UUIDGenerator.generateUuid6();
//        String uuid4 = "8a0981";
        params.put("rand_str", uuid4);
        long time = DateUtils.getNowDate().getTime() / 1000;
//        long time = 1655431904;
        params.put("timestamp", time);

        //key + secret + rand_str + timestamp
        String oldSign = "key=" + key + ",secret=" + secret + ",rand_str=" + uuid4 + ",timestamp=" + time;
        log.info("oldSign={}", oldSign);
        String sign = DigestUtils.md5Hex(oldSign);
        log.info("sign={}", sign);
        log.info("uuid4={}", uuid4);
        sign = DigestUtils.sha1Hex(sign + uuid4);
        log.info("sign={}", sign);
        params.put("sign", sign);


        Integer id = KJCoverGameType.getId(type);

//        String url = "https://kejinlianmeng.com/api_up/account/config/servers";
        String url = "https://kejinlianmeng.com/api_up/account/config/property";
//        String url = "https://kejinlianmeng.com/api_up/account/config/games";

        params.put("game_id", id);
        String paramsStr = JSONObject.toJSONString(params);
        log.info("氪金兽游戏类型请求={}", paramsStr);
        String response = HttpUtils.sendPost(url, paramsStr, "application/json");
        Integer status = JSONObject.parseObject(response).getInteger("status");
        if (0 == status) {
            JSONObject jsonObject = JSONObject.parseObject(response);
            JSONArray data = JSONArray.parseArray(jsonObject.getString("data"));
            log.info("氪金兽游戏类型返回={}", JSONObject.toJSONString(data));
            return data;
        }
        return null;
    }

    //先别删
    public static void main(String[] args) {
        String key = "102773kjs197bc4cf23";
        String secret = "c8d97cd60bf5a28415920d3a07e3ee";

        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("secret", secret);
        String uuid4 = UUIDGenerator.generateUuid6();
//        String uuid4 = "8a0981";
        params.put("rand_str", uuid4);
        long time = DateUtils.getNowDate().getTime() / 1000;
//        long time = 1655431904;
        params.put("timestamp", time);

        //key + secret + rand_str + timestamp
        String oldSign = "key=" + key + ",secret=" + secret + ",rand_str=" + uuid4 + ",timestamp=" + time;
        log.info("oldSign={}", oldSign);
        String sign = DigestUtils.md5Hex(oldSign);
        log.info("sign={}", sign);
        log.info("uuid4={}", uuid4);
        sign = DigestUtils.sha1Hex(sign + uuid4);
        log.info("sign={}", sign);
        params.put("sign", sign);


        Integer id = KJCoverGameType.getId(GameTypeConstant.LOLMOBILE);

//        String url = "https://kejinlianmeng.com/api_up/account/config/servers";
        String url = "https://kejinlianmeng.com/api_up/account/config/property";
//        String url = "https://kejinlianmeng.com/api_up/account/config/games";

        params.put("game_id", id);
        String paramsStr = JSONObject.toJSONString(params);
        log.info("氪金兽游戏类型请求={}", paramsStr);
        String response = HttpUtils.sendPost(url, paramsStr, "application/json");
        Integer status = JSONObject.parseObject(response).getInteger("status");
        if (0 == status) {
            JSONObject jsonObject = JSONObject.parseObject(response);
            JSONArray data = JSONArray.parseArray(jsonObject.getString("data"));
            log.info("氪金兽游戏类型返回={}", JSONObject.toJSONString(data));
        }

//        log.info("氪金兽游戏类型请求={}",paramsStr);
//        String response = HttpUtils.sendPost(url, paramsStr);
//        log.info("氪金兽游戏类型返回={}",response);
    }
}
